package com.mornd.gulimall.seckill.feign;

import com.mornd.gulimall.apis.coupon.to.SeckillSkuRelationTo;
import com.mornd.gulimall.apis.seckill.ISeckillClient;
import com.mornd.gulimall.common.core.result.R;
import com.mornd.gulimall.seckill.service.ISeckillService;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: mornd
 * @dateTime: 2023/8/29 - 16:52
 */

@RestController
public class SeckillClient implements ISeckillClient {
    @Resource
    private ISeckillService seckillService;

    @Override
    public R<SeckillSkuRelationTo> getSkuSeckillInfo(Long skuId) {
        SeckillSkuRelationTo seckillInfo = seckillService.getSkuSeckillInfo(skuId);
        return R.ok(seckillInfo);
    }
}
